
using Nop.Core.Domain.WindAlert;

namespace Nop.Data.Mapping.Windalert
{
    public partial class AlertsMap : NopEntityTypeConfiguration<Alert>
    {
        public AlertsMap()
        {
            this.ToTable("WAlert");
            this.HasKey(sc => sc.Id);
            
            this.HasRequired(sc => sc.Customer)
                .WithMany()
                .HasForeignKey(sc => sc.CustomerId);


            this.HasRequired(sp => sp.SpotsGroup)
                .WithMany(s => s.spotsGroupCustomers)
                .HasForeignKey(sc => sc.SpotsGroupId);

            this.Ignore(sg => sg.AlertOption);
        }
    }
}